<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <div v-background v-border>
            <p>哈哈</p>
        </div>

        <ul>
            <li>哈哈</li>
            <li>哈哈</li>
            <li  v-background>哈哈</li>
            <li  v-border>哈哈</li>
            <li>哈哈</li>
        </ul>

        <p v-background v-border>你好狗蛋</p>
    </div>
</body>
<script src="./vue.min.js"></script>
<script>
    // 自定义属性
    Vue.directive('background', {
        bind(el) {
            el.style.background = "red";
        }
    });

    Vue.directive('border', {
        bind(el) {
            el.style.border = "3px solid black";
        }
    });
    var vm = new Vue({
        el:"#app",
        data:{
            msg:""
        },

    })
</script>
</html>